主题
骨架化 - Skeletonize
函数简介
对二值图像进行骨架化处理,提取细化的骨架结构。
接口名称
SkeletonizeDLL调用
int64_t Skeletonize(int64_t instance, int64_t ptr);参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| ptr | 长整数型 | 图像指针(推荐二值图) |
示例
SDK 调用
cpp
#include "OLAPlugServer.h"
OLAPlugServer ola;
long handle = ola.Skeletonize(0);csharp
using OLAPlug;
var ola = new OLAPlugServer();
long handle = ola.Skeletonize(0);python
from OLAPlugServer import OLAPlugServer
ola = OLAPlugServer()
handle = ola.Skeletonize(0)java
import com.olaplug.OLAPlugServer;
OLAPlugServer ola = new OLAPlugServer();
long handle = ola.Skeletonize(0);cpp
var ola = com("OlaPlug.OlaSoft")
var handle = ola.Skeletonize(0)vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
handle = ola.Skeletonize(0)text
.局部变量 ola, OLAPlug
ola.创建 ()
handle = ola.Skeletonize(0)aardio
import OLAPlugServer;
var ola = OLAPlugServer();
var handle = ola.Skeletonize(0);text
变量 ola <类型 = OLAPlugServer>
ola = 新建 OLAPlugServer
长整数 handle = ola.Skeletonize(0)cpp
#include "OLAPlugServer.h"
OLAPlugServer ola;
long handle = ola.Skeletonize(0);原生 DLL 调用
cpp
Skeletonize(instance, 0);csharp
using System.Runtime.InteropServices;
using System.Text;
[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern int Skeletonize(long ola, int ptr);
Skeletonize(instance, 0);python
from ctypes import CDLL, c_int, c_int64, create_string_buffer
ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
ola.Skeletonize(instance, 0)返回值
长整数型:返回骨架化后的图像句柄,失败返回0。
注意事项
- 骨架化对输入阈值化效果敏感,建议先做去噪与阈值化。
- 返回的图像需调用 FreeImagePtr 释放内存。
